//
//  MYViewController.m
//  textfiled格式化
//
//  Created by iOS on 16/6/20.
//  Copyright © 2016年 iOS. All rights reserved.
//

#import "MYViewController.h"
#import "ZJTextfieldView.h"
@interface MYViewController ()<UITextFieldDelegate>
@property (weak, nonatomic) IBOutlet ZJTextfieldView *ZJtextfiledV;

@end

@implementation MYViewController

- (void)viewDidLoad {
    [super viewDidLoad];
 
    
    self.ZJtextfiledV.ZJtextfield.borderStyle = UITextBorderStyleRoundedRect;
    self.ZJtextfiledV.ZJTextfieldStyle = ZJTextFieldStyleAccount;
    self.ZJtextfiledV.ZJtextfield.placeholder = @"账号  ZJTextFieldStyleAccount";
    // Account.talbeListArray = [NSMutableArray arrayWithArray:@[@"wewe",@"sdsdsd",@"sdsdsd"]];
    self.ZJtextfiledV.ZJtextfield.delegate = self;
    //[self addSubview:Account];

    // Do any additional setup after loading the view from its nib.
}
- (void)textFieldDidBeginEditing:(UITextField *)textField{
    
    if (textField == self.ZJtextfiledV.ZJtextfield) {
        [self.ZJtextfiledV ZJtextFieldCreateTableviewDidBeginEditing:textField];
    }
    //return YES;
    
}

- (void)textFieldDidEndEditing:(UITextField *)textField{
    if (textField == self.ZJtextfiledV.ZJtextfield) {
        [self.ZJtextfiledV ZJtextFieldWriteTextDidEndEditing:self.ZJtextfiledV.ZJtextfield];
    }
    
    
}



- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
    if (textField == self.ZJtextfiledV.ZJtextfield) {
        return [self.ZJtextfiledV ZJtextField:textField shouldChangeCharactersInRange:range replacementString:string];
    }
    
    return YES;
}

- (BOOL)textFieldShouldReturn:(UITextField *)textField{
    if (textField == self.ZJtextfiledV.ZJtextfield) {
        return [self.ZJtextfiledV ZJtextFieldShouldReturn:textField];
    }
    
    
    return YES;}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
